#include("common.html")
<html>
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <title>澳邮国际商城</title>
    
    <meta name="viewport" content="initial-scale=1, maximum-scale=1">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="format-detection" content="telephone=no">
    <meta name="full-screen" content="yes">
    <meta name="x5-fullscreen" content="true">
    <link rel="stylesheet" type="text/css" href="#(tpath)/static/css/vant.css">
    <link rel="stylesheet" type="text/css" href="#(tpath)/static/css/filter.css">
        <style type="text/css">
    


    .mui-input-group {
				margin-top: 10px;
			}
			
			.mui-input-group:first-child {
				margin-top: 20px;
			}
			
			.mui-input-group label {
				width: 22%;
			}
			
			.mui-input-row label~input,
			.mui-input-row label~select,
			.mui-input-row label~textarea {
				width: 78%;
			}
			
			.mui-checkbox input[type=checkbox],
			.mui-radio input[type=radio] {
				top: 6px;
			}
			
			.mui-content-padded {
				margin-top: 25px;
			}
			
			.mui-btn {
				padding: 10px;
			}
    </style>
    <link rel="stylesheet" type="text/css" href="#(tpath)/static/mui/css/mui.css"/>
	<link rel="stylesheet" type="text/css" href="#(tpath)/static/mui/css/mui.picker.css"/>
	<link rel="stylesheet" type="text/css" href="#(tpath)/static/mui/css/mui.poppicker.css" />
    <script type="text/javascript" src="#(tpath)/static/js/jquery.js"></script>
    <script type="text/javascript" src="#(tpath)/static/js/common.js"></script>
    <script type="text/javascript" src="#(tpath)/static/mui/js/mui.js"></script>
    <script type="text/javascript" src="#(tpath)/static/mui/js/mui.picker.js"></script>
    <script type="text/javascript" src="#(tpath)/static/mui/js/mui.poppicker.js"></script>
    <script type="text/javascript" src="#(tpath)/static/mui/js/city.data-3.js"></script>
  </head>
  
  <body class="">
    <style type="text/css">@media only screen and (min-width: 320px){ html { font-size: 62.5% !important; } } @media only screen and (min-width: 640px){ html { font-size: 125% !important; } } @media only screen and (min-width: 750px){ html { font-size: 150% !important; } } @media only screen and (min-width: 1242px){ html { font-size: 187.5% !important; } }</style>
    <!-- 样式 S -->
    <style type="text/css" lang="less">/* 区块样式 */ #ordersub .marginTop{margin-top:10px;} #ordersub .cart-title{font-weight:600;} #ordersub .red{color:#cb3029;} #ordersub .van-card{background:#fff;border-bottom:1px solid #eee;} #ordersub .van-card__img{} #ordersub .van-card:not(:first-child){margin-top:0;} #ordersub .weight{color:#999;font-size:12px;} #ordersub .van-cell__value{width:40px;} #ordersub .express .van-cell__title, .van-cell__value{-webkit-box-flex: 1 1 auto;-webkit-flex: 1 1 auto;flex: 1 1 auto;} /* tips样式 */ #ordersub .add_address {color: #38f;} /* 地址簿样式 Start */ #ordersub .van-address-list__edit{right:30px} #ordersub .van-address-list{height:93%;padding-bottom:0;position: relative;} #ordersub .van-radio-group{/* height:94%; */overflow-y:scroll;} #ordersub .addrList{top:10%;padding-bottom:50px} /* 地址簿样式 End */ /* 包裹拆分样式 Start */ #ordersub .splitpkg{background-color:#ffffff;height:100%;} #ordersub .splitpkg .van-button{border-radius: 0px;position:fixed;bottom:0;left:0;} #ordersub .splitpkg .van-cell__title{ -webkit-box-flex: 10; -webkit-flex: 10; flex: 10; -webkit-line-clamp: 2; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-box-orient: vertical;} /* #ordersub .splitpkg .van-cell:not(:last-child)::after{border:0}*/ #ordersub .pkg_title {margin: 0;font-weight: 600;font-size: 2rem;color: #333333;padding: 1rem 0 0 1rem;} #ordersub .pop_close_btn {position: fixed;} /* 包裹拆分样式 End */ /* 下单结果样式 Start */ #message .van-circle{margin-left:-50px;left:50%;top:20%;margin-top:50px;} #message .text-center{text-align:center;} #message .p1{margin:10px 0 5px 0;} #message .p2{margin:0 0 20px 0;color:#666;} #message .icon{font-size:100px;left:50%;margin-left:-50px;margin-top:50px;} #message .marginTop{margin-top:15px;} #message .van-cell .van-cell__title{color:#999;} .van-submit-bar__price::first-letter{font-size:inherit} /* 下单结果样式 End */ .van-card{padding: 10px 15px;} #order_content{padding-bottom:90px;} #order_content .van-contact-card{ padding: 10px 15px; } .coupon_pop .van-coupon-item__content{ padding: 10px; } .coupon_pop .van-coupon-item__head{ min-width: 110px; text-align: center; } .cost-content{ padding: 5px 0px 0px; box-sizing: border-box; background-color: #fff; } .cost-content .van-cell__title{ color: #969799; } .cost-content .van-cell{ line-height: 12px; padding: 5px 15px; font-size: 12px; } .order-amount-cell{ padding: 5px 15px !important; } .order-amount-cell .van-cell__title{ color: #323233; font-size: 14px; font-weight: 600; } .order-amount-cell .van-cell__value{ color: #323233; font-size: 14px; font-weight: 600; } .cost-group .van-cell{ font-weight:600; padding: 5px 15px; margin-top: 10px; } .order-amount .van-cell__value{ color: #f44; } .card-content{ margin-top: 10px; } .card-content .van-card__thumb{ width: 60px; height: 60px; } .card-content .van-card__content{ height: 70px; } .card-content .van-cell{ padding: 5px 15px; font-size: 12px; line-height: 18px; } .discounts-icon{ margin-left: 5px; float: left; margin-top: 2px; } .cost-use{ padding: 10px 15px; background-color: #fdfdfd; position: relative; } .cost-use .van-cell{ line-height: 12px; padding: 5px 15px; font-size: 12px; background-color: #eee; } .cost-use .van-cell__value{ font-size: 16px; } .cost-use-detail{ color: #969799; font-size: 10px; text-align: right; width: 100%; } .cost-use-account{ color: #969799; font-size: 12px; width: 100%; padding: 2px 0px; box-sizing: border-box; } .cost-use-actually{ color: #323233; font-size: 14px; width: 100%; font-weight: 600; } .use-actually-right{ color: #f44; font-size: 16px; float: right; } .order-line-content{ height: 10px; position: relative; background-color: #fff; } .order-line{ width: 90%; border-bottom: 1px solid #eee; position: absolute; bottom: 0; left: 0; } .order-line2{ width: 7%; border-bottom: 1px solid #eee; position: absolute; bottom: 0; right: 0; } .arrow-icon{ position: absolute; bottom: -4px; left: 90%; color: #eee; } .splitpkg .van-panel{margin: 0.5rem 0;} .splitpkg .van-cell{font-size: 12px;line-height:20px;} .suspend{ width: 100%; height: 100%; position: relative; z-index: 999; background-color: rgba(0,0,0,.6); position: fixed; top: 0; left: 0; } .suspend-content{ width: 244px; height: 55px; position: fixed; top: 70%; z-index: 900; } .suspend-content-left{ width: 44px; height: 40px; background-color: rgba(0,0,0,.6); color: #fff; font-size: 8px; padding: 3px; box-sizing: border-box; border-top-left-radius:5px; border-bottom-left-radius:5px; margin-top: 10px; float: left; } .suspend-icon{ float: left; width: 10px; height: 30px; padding: 5px 0px; margin-right: 3px; font-size: 14px; } .suspend-navigation{ float: left; width: 25px; height: 30px; padding: 5px 0px; box-sizing: border-box; font-size: 10px; } .suspend-navigation2{ float: left; width: 25px; height: 30px; padding: 10px 0px; box-sizing: border-box; font-size: 10px; } .suspend-content-right{ width: 200px; height: 60px; background-color: #fff; float: left; border-top-left-radius:5px; border-bottom-left-radius:5px; padding: 15px 10px; box-sizing: border-box; } .suspend-content-right .van-col{ text-align: center; } .suspend-contact{ font-size: 20px; } .suspend-contact-text{ font-size: 10px; transform: scale(0.7); } .wechat-customer .wechat-bg{background:#333;opacity:0.5;width:100%;z-index:999;position:fixed;top:0;bottom:0;} .wechat-customer .wechat-cont{width:12rem;background:#fff;border-radius:5px;position:fixed;top:50%;left:50%;margin-left:-8rem;z-index:999;text-align:center;padding:2rem;margin-top:-10rem;} .wechat-customer .wechat-cont img{width:10rem;height:10rem;} .wechat-customer .wechat-cont .closewindow{position:absolute;right:1rem;top:1rem;} .wechat-customer .wechat-cont .button1{width: 12rem; height: 2rem; line-height: 2rem; border: 0px; margin: 0rem auto 0 auto; color: #999; font-size: 12px;} .wechat-customer .wechat-cont .button2{width:12.1rem;height:2rem;background:#2ba246;color:#fff;border:1px solid #2ba246;margin-top:0.5rem;} .van-submit-bar{ border-top: 1px solid #eee; } /*.coupon_pop .van-radio{ padding: 0px 15px; border-bottom: 1px solid #eee; }*/ /*.send_radio .van-radio__label{ width: 90%; }*/ .borderColor1{border-left:10px solid #199ED8;} .borderColor2{border-left:10px solid #FF3366;} .borderColor3{border-left:10px solid #3366FF;} .card-content .van-card__price{ color: #7d7e80; } .submit-bar{ z-index:100; position:fixed; bottom:0; left:0; width:100%; -webkit-user-select:none; user-select:none; border-top:1px solid #eee; } .submit-bar__bar{ display:-webkit-flex; display:flex; -webkit-align-items:center; align-items:center; height:50px; background-color:#fff; font-size:14px; } .submit-bar__text{ -webkit-flex:1; flex:1; color:#333; font-weight:500; text-align:right; } .submit-bar__price{ color:#f44; font-size:18px; padding-right:12px; } .submit-bar__currency{ font-size:14px; } .submit-bt{ border-radius:0; width:110px; height:50px; line-height:48px; color:#fff; background-color:#f44; position:relative; padding:0; display:inline-block; box-sizing:border-box; font-size:16px; text-align:center;
      vertical-align:middle; -webkit-appearance:none; -webkit-text-size-adjust:100%; } .fr{ float: right; }</style>
    <!-- 样式 End -->
    <!--样式-->
    <!-- 地址列表 start -->
    <style type="text/css">.contact-lable { font-size: 14px; color: #333; margin-left: 10px; } .no-img-content{ width: 100%; text-align: center; background-color: #fff; height: 100%; } .no-img{ max-width: 200px; max-height: 200px; margin-top: 20px; } .no-img-title{ font-size: 14px; color: #BBBBBB; } .add-address { width: 100%;position: fixed; bottom: 0; left: 0; z-index: 600; background-color: #fff; height: 50px; } .cell-icon{ width: 30px; height: 30px; text-align: right; }</style>
    <!-- 地址列表 end -->
    
    <!-- 地址添加 start -->
    <style>.fl{float:left;} .fr{float:right;} .cl{clear:both;} ::-webkit-input-placeholder {color: #999;} .container{background:#ffffff;padding:3%;} .container .title{color:#333333;font-size:16px} .paste-addres{width:100%;height:90px;background:#f5f5f5;padding:10px;margin-top:10px;box-sizing: border-box;} .container .inter-rec{width:90%;height:40px;background:#f5f5f5;border:none;} .receiver-input{margin-top:5px;} .receiver-input .receiver-name{width:48%;height:40px;border-bottom:1px solid #f5f5f5;font-size:12px;border-top:none;border-left:none;border-right:none;} .receiver-input .receiver-area{width:100%;height:40px;border-bottom:1px solid #f5f5f5;font-size:12px;border-top:none;border-left:none;border-right:none;} .reminder{background:#f4f4f5;width:96%;padding:2%;margin-top:10px;font-size:12px;color:#909399;} .reminder .reminder-icon{width:7%;margin-top:2px} .reminder .reminder-text{width:92%;font-size:12px;} .submit-btn{border:none;color:#ffffff;width:100%;font-size:16px;height:40px;margin-top:10px;} .upload-icard{margin-top:10px;} .upload-icard .front{width:48%;height:112px;} .upload-icard .back{width:48%;height:112px;} .span-right{span-align:right;} .upoload-examle{margin-top:10px;margin-bottom:10px} .upoload-examle span{font-size:12px;color:#cccccc;} .paste-addres .button-style{background:#333333;color:#ffffff;font-size:12px;border-radius:3px;padding:5px 10px;border:none;}</style>
    <!-- 地址添加 end -->
    
    <!-- 内容 Start -->
    <form id="orderForm">
    <div id="ordersub" class="container">
      <div id="order_content">
      	<input type="hidden" name="receiverId" id="receiverId" value="#if(receiver??)#(receiver.id)#end"/>
      	<input type="hidden" name="couponId" id="couponId" value="#(couponId)"/>
        #if(orderType=="CART_BUY")
        #else
        <input type="hidden" name="productId" value="#(productId)"/>
        <input type="hidden" name="quantity" value="#(quantity)"/>
        #end
        <input type="hidden" name="orderType" value="#(orderType)"/>
      
      	#if(receiver??)
      	<div class="van-cell van-cell--center van-cell--borderless van-cell--clickable van-contact-card van-contact-card--edit" id="chooseReceiver">
		  <i class="van-icon van-icon-contact van-cell__left-icon">
		    <!---->
		    <!----></i>
		  <!---->
		  <div class="van-cell__value van-cell__value--alone">
		    <div>姓名：<span id="receiverConsignee">#(receiver.consignee)</span></div>
		    <div>电话：<span id="receiverPhone">#(receiver.phone)</span></div></div>
		  <i class="van-icon van-icon-arrow van-cell__right-icon">
		    <!---->
		    <!----></i>
		</div>
      	#else
        <div class="van-cell van-cell--center van-cell--borderless van-cell--clickable van-contact-card van-contact-card--add" onclick="location.href='#(base)/receiver/list'">
          <i class="van-icon van-icon-add-square van-cell__left-icon">
            <!---->
            <!----></i>
          <!---->
          <div class="van-cell__value van-cell__value--alone">选择收件人地址</div>
          <i class="van-icon van-icon-arrow van-cell__right-icon">
            <!---->
            <!----></i>
        </div>
      	#end
        
        <!---->
        <div class="card-content">


          #if(orderType=="CART_BUY")
          #for(cartItem : currentCart.selectCartItems)
          <div class="van-card van-card--center">
            <a class="van-card__thumb">
              <img src="#(imageUrl(cartItem.product.image))" width="60" height="60" class="van-card__img">
              <!----></a>
            <div class="van-card__content">
              <div>
                <!---->#(cartItem.product.name)</div>
              <div>重量：#(cartItem.product.weight)</div>
              <div class="van-card__bottom">
                <div class="van-card__price">￥ #(cartItem.price)</div>
                <!---->
                <div class="van-card__num">x #(cartItem.quantity)</div></div>
            </div>
            <!----></div>
            #end
            #else
            
            <div class="van-card van-card--center">
            <a class="van-card__thumb">
              <img src="#(imageUrl(product.image))" width="60" height="60" class="van-card__img">
              <!----></a>
            <div class="van-card__content">
              <div>
                <!---->#(product.name)</div>
              <div>重量：#(product.weight)</div>
              <div class="van-card__bottom">
                <div class="van-card__price">￥ #(product.realPrice)</div>
                <!---->
                <div class="van-card__num">x #(quantity)</div></div>
            </div>
            <!----></div>
            #end
        </div>
        <div class="marginTop van-cell-group van-hairline--top-bottom" onclick="location.href='#(base)/coupon/choose'">
          <div class="van-cell van-cell--clickable van-coupon-cell">
            <!---->
            <div class="van-cell__title">
              <span>优惠券</span>
              <!----></div>
            <div class="van-cell__value">
              <span>#if(coupon??) #(coupon.name) #else 使用优惠 #end</span></div>
            <i class="van-icon van-icon-arrow van-cell__right-icon">
              <!---->
              <!----></i>
          </div>
        </div>
        <!---->
        <div class="cost-group van-cell-group van-hairline--top-bottom">
          <div class="van-cell">
            <i class="van-icon van-icon-question-o van-cell__left-icon">
              <!---->
              <!----></i>
            <div class="van-cell__title">
              <span>订单金额明细</span>
              <!----></div>
            <!---->
            <!----></div>
        </div>
        <div class="cost-content van-cell-group">
          <div class="van-cell van-cell--borderless">
            <!---->
            <div class="van-cell__title">
              <span>商品总额</span>
              <!----></div>
            <div class="van-cell__value">
              <span>￥ #(productPrice)</span></div>
            <!----></div>
          <div class="van-cell van-cell--borderless">
            <!---->
            <div class="van-cell__title">
              <span>运费总额</span>
              <!----></div>
            <div class="van-cell__value">
              <span>￥ #(freightPrice)</span></div>
            <!----></div>
          <!---->
          <div class="order-amount-cell van-cell van-cell--borderless">
            <!---->
            <div class="van-cell__title">
              <span>订单总价</span>
              <!----></div>
            <div class="van-cell__value">
              <span>￥ #(orderPrice)</span></div>
            <!----></div>
          <div class="order-line-content">
            <div class="order-line"></div>
            <i class="arrow-icon van-icon van-icon-arrow-up">
              <!---->
              <!----></i>
            <div class="order-line2"></div>
            <div style="clear: both;"></div>
          </div>
          <div class="cost-use">
            <div class="cost-use-detail">支付明细</div>
            <div class="cost-use-account">
              <span style="float: left;">商品优惠</span>
              <!---->
              <i class="discounts-icon van-icon van-icon-question-o">
                <!---->
                <!----></i>
              <span style="float: right;">-￥ #if(coupon??) #(coupon.price) #else 0.00 #end</span>
              <div style="clear: both;"></div>
            </div>
            <!-- <div class="cost-use-account">
              <span style="float: left;">余额抵扣</span>
              <span style="float: right;">-￥ 0.00</span>
              <div style="clear: both;"></div>
            </div> -->
            <!---->
            <!-- <div class="cost-use-account">
              <span style="float: left;">手续费</span>
              <span style="float: right;">￥ 0.00</span>
              <div style="clear: both;"></div>
            </div> -->
            <!---->
            <div class="cost-use-actually">
              <span style="float: left;">实付金额</span>
              <span class="use-actually-right" style="float: right; color: rgb(42, 101, 170);">￥ #(orderPrice)</span>
              <div style="clear: both;"></div>
            </div>
          </div>
        </div>
        <div class="marginTop van-cell-group van-hairline--top-bottom">
          <div class="van-cell van-field">
            <!---->
            <div class="van-cell__title">
              <span>订单留言</span>
              <!----></div>
            <div class="van-cell__value">
              <div class="van-field__body">
                <textarea placeholder="请输入留言" rows="1" class="van-field__control" style="height: 24px;" id="inputMemo" name="memo"></textarea>
                <!---->
                <!---->
                <!----></div>
              <!----></div>
            <!----></div>
        </div>
        <div class="submit-bar">
          <div class="submit-bar__bar">
            <div class="submit-bar__text">
              <span>合计</span>
              <span class="submit-bar__price" style="color: rgb(42, 101, 170);">
                <span class="submit-bar__currency">￥</span><span id="orderPrice" orderPrice="#(orderPrice)">#(orderPrice)</span></span></div>
            <button class="submit-bt van-button van-button--default van-button--normal" style="background-color: rgb(42, 101, 170);" id="payBtn" #if(orderPrice<=0) disabled="disabled"  #end>
              <span class="van-button__text">提交订单</span></button>
          </div>
          <!---->
          <!---->
          <!----></div>
      </div>
    </div>
    </form>
    
    <div id="receiverListDiv" class="container" style="display: none;">
    
    </div>
    
   <div id="receiverAddDiv" class="container" style="display: none;padding: 0%;">
    
    </div>
    
    <div class="van-overlay" style="z-index: 2006; display: none;" id="showoverlay"></div>
    
    <!-- 逻辑 Start -->
    <div class="van-toast van-toast--default van-toast--middle" style="z-index: 2004; display: none;" id="showloading">
      <!---->
      <!---->
      <div class="van-loading van-loading--circular van-loading--white" style="color: white;">
        <span class="van-loading__spinner van-loading__spinner--circular">
          <svg viewBox="25 25 50 50" class="van-loading__circular">
            <circle cx="50" cy="50" r="20" fill="none"></circle>
          </svg>
        </span>
      </div>
      <div class="van-toast__text">加载中...</div></div>
    <!-- 逻辑 End -->
    </body>

</html>
<script type="text/javascript">

//页面返回 强刷
//页面可见性改变事件
window.addEventListener( "pageshow", function ( event ) {
  var historyTraversal = event.persisted ||
                         ( typeof window.performance != "undefined" &&
                              window.performance.navigation.type === 2 );
  if ( historyTraversal ) {
    // Handle page restore.
    window.location.reload();
  }
});

$("#payBtn").on("click",function(){
	var receiverId = $("#receiverId").val();
	if(isEmpty(receiverId)){
		alert("收件人地址不能为空!");
		return;
	}
	$("#showloading").show();
	$.ajax({
        url: "#(base)/order/save",
        type: "post",
        data: $("#orderForm").serialize(),
        dataType: "json",
        success: function(res){
            console.log(res);
        	$("#showloading").hide();
        	if(res.type=="success"){
        		//
              location.href="#(base)/order/payment?orderId="+res.data.orderId;
        	}else{
        		alert(res.msg);
        	}
        },
        error: function(res){
        	$("#showloading").hide();
        }
    });
	return false;
});

</script>
<script>

	function loadReceiverList(){
		$.ajax({
            url: "#(base)/receiver/list",
            type: "post",
            data: {
           	},
            dataType: "text",
            success: function(res){
            	$("#receiverListDiv").html(res);
            	$("#receiverListDiv").show();
            	$("#ordersub").hide();
            	$("#receiverAddDiv").hide();
            },
            error: function(res){
            }
        });
	}
	
	$("#chooseReceiver").on("click",function(){
		loadReceiverList();
	});
	
	$("#receiverListDiv").on("click","#addAddress",function(){
		$.ajax({
            url: "#(base)/receiver/add",
            type: "post",
            data: {
           	},
            dataType: "text",
            success: function(res){
            	$("#receiverAddDiv").html(res);
            	$("#receiverAddDiv").show();
            	$("#receiverListDiv").hide();
            	$("#ordersub").hide();
            },
            error: function(res){
            }
        });
		
	});
	
	$("#receiverListDiv").on("click",".editAddress",function(){
		var receiverId = $(this).attr("receiverId");
		$.ajax({
            url: "#(base)/receiver/edit",
            type: "post",
            data: {
            	"id":receiverId
           	},
            dataType: "text",
            success: function(res){
            	$("#receiverAddDiv").html(res);
            	$("#receiverAddDiv").show();
            	$("#receiverListDiv").hide();
            	$("#ordersub").hide();
            },
            error: function(res){
            }
        });
		
	});
	
	$("#receiverListDiv").on("click",".selectAddress",function(){
		var consignee = $(this).attr("consignee");
		var phone = $(this).attr("phone");
		var receiverId = $(this).attr("receiverId");
		$("#receiverId").val(receiverId);
		$("#receiverConsignee").html(consignee);
		$("#receiverPhone").html(phone);
		$("#receiverAddDiv").hide();
    	$("#receiverListDiv").hide();
    	$("#ordersub").show();
	});
	
	$("#receiverAddDiv").on("click","#receiverAddBack",function(){
		$("#receiverAddDiv").hide();
    	$("#receiverListDiv").show();
    	$("#ordersub").hide();
	});
	
	$("#receiverListDiv").on("click","#receiverListBack",function(){
		$("#receiverAddDiv").hide();
    	$("#receiverListDiv").hide();
    	$("#ordersub").show();
	});
	$("#receiverAddDiv").on("click","#deleteBtn",function(){
		var receiverId = $(this).attr("receiverId");
    	$.ajax({
            url: "#(base)/receiver/delete",
            type: "post",
            data: {
            	"id":receiverId
           	},
            dataType: "json",
            success: function(res){
            	if(res.type=="success"){
            		loadReceiverList();
           		}
            },
            error: function(res){
            }
        });
    	
    	
    });
	$("#receiverAddDiv").on("click","#receiverBtn",function(){
    	var consignee = $("#consignee").val();
    	if(isEmpty(consignee)){
    		alert("请输入收货人姓名");
    		return;
    	}
    	var phone = $("#phone").val();
    	if(isEmpty(phone)){
    		alert("请输入收货人手机号码");
    		return;
    	}
    	var phoneReg = /(^1[3|4|5|7|8|9]\d{9}$)|(^09\d{8}$)/;
    	if (!phoneReg.test(phone)) {
    		alert("请输入正确的手机号码");
    		return;
    	}
    	
    	var area = $("#addressPicker").val();
    	if(area==""){
    		alert("请选择所在地区");
    		return;
    	}
    	var province = area.split(",")[0];
    	var city = area.split(",")[1];
    	var district = area.split(",")[2];
    	var address = $("#address").val();
    	if(isEmpty(address)){
    		alert("请输入详细地址");
    		return;
    	}
    	var receiverId = $(this).attr("receiverId");
    	var url="";
    	if(receiverId==""){
    		url="#(base)/receiver/save";
    	}else{
    		url="#(base)/receiver/update";
    	}
    	$.ajax({
            url: url,
            type: "post",
            data: {
            	"consignee":consignee,
            	"phone":phone,
            	"province":province,
            	"city":city,
            	"district":district,
            	"address":address,
            	"id":receiverId
           	},
            dataType: "json",
            success: function(res){
            	if(res.type=="success"){
            		loadReceiverList();
           		}
            },
            error: function(res){
            }
        });
    });
</script>